package com.lishe.lishe.lishe.module.myorder.bean;

import com.google.gson.annotations.SerializedName;

import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * Created by shino on 2017/8/11.
 */

public class OrderObject implements Serializable {

    @SerializedName("created_time")
    private String created_time;//创建时间

    @SerializedName("is_overdue")
    private String is_overdue;//是否过期,0过期 ,1未过期

    @SerializedName("money")
    private double money;//总金额

    @SerializedName("payment_id")
    private String payment_id;//支付id
    //     订单状态：cancel_status-NO_APPLY_CANCEL
//    已取消(未付款)：TRADE_CLOSED_BY_SYSTEM/TRADE_CLOSED_BY_USER/TRADE_CLOSED_BY_ADMIN
//    待付款：WAIT_BUYER_PAY
//    待发货：WAIT_SELLER_SEND_GOODS
//    待收货：WAIT_BUYER_CONFIRM_GOODS
//    待评论：WAIT_COMMENT
//    已完成：TRADE_FINISHED
//    备货中：IN_STOCK
    @SerializedName("status")
    private String status;

    @SerializedName("sync_trade_status")
    private String sync_trade_status;//值为null(为公司生成)和success都为订单成功，failure则失败订单，不可进行支付操作

    @SerializedName("trade_paybillData")
    private List<BusinessObject> trade_paybillData=new ArrayList<>();//商家列表


    /**
     * 订单状态：0、全部订单；1、待付款；2、代发货；3、待收货；4、已完成；5、退款/退货
     */
    private int orderType = 0;

    // 	福利订单号
    @SerializedName("orderNo")
    private String orderNo;
    // 	福利订单状态Id
    @SerializedName("id")
    private String orderId;
    // 	福利订单状态
    @SerializedName("orderStatus")
    private String orderStatus;//订单状态：0:支付成功 1:员工领取中 2:订单准备中 3:已发货 4:已完成’

    @SerializedName("is_global")
    private int is_global;//0为非全球购商品，1为全球购商品


    /**
     * 生成订单及确认订单所需参数
     */
    private ArrayList<String> carIds = new ArrayList<>();//create的所有carid
    private List<String> shopIds = new ArrayList<>();//createfinnish的所有商店shopIds
    private List<String> itemIds = new ArrayList<>();//createfinnish的所有itemIds
    private List<String> dlytmplIds = new ArrayList<>();//createfinnish的所有dlytmplIds
    private List<String> postFees = new ArrayList<>();//createfinnish的所有postFees
    private List<String> skuIds = new ArrayList<>();//createfinnish的所有skuIds
    private List<String> remarks = new ArrayList<>();//createfinnish的所有remarks

    public String getCreated_time() {
        return created_time;
    }

    public void setCreated_time(String created_time) {
        this.created_time = created_time;
    }

    public String getIs_overdue() {
        return is_overdue;
    }

    public void setIs_overdue(String is_overdue) {
        this.is_overdue = is_overdue;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getPayment_id() {
        return payment_id;
    }

    public void setPayment_id(String payment_id) {
        this.payment_id = payment_id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSync_trade_status() {
        return sync_trade_status;
    }

    public void setSync_trade_status(String sync_trade_status) {
        this.sync_trade_status = sync_trade_status;
    }

    public List<BusinessObject> getTrade_paybillData() {
        return trade_paybillData;
    }

    public void setTrade_paybillData(List<BusinessObject> trade_paybillData) {
        this.trade_paybillData = trade_paybillData;
    }

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getStatusToString() {
        if (status.equals("WAIT_BUYER_PAY")) {
//            return "待付款";
            return "待付款";
        }
        if (status.equals("TRADE_CLOSED_BY_USER") || status.equals("TRADE_CLOSED_BY_SYSTEM") || status.equals("TRADE_CLOSED_BY_ADMIN")) {
            return "已取消";
        }
        if (status.equals("WAIT_SELLER_SEND_GOODS")) {
//            return "待发货";
            return "买家已付款";
        }
        if (status.equals("WAIT_BUYER_CONFIRM_GOODS")) {
//            return "待收货";
            return "卖家已发货";
        }
        if (status.equals("TRADE_FINISHED")) {
//            return "已完成";
            return "交易成功";
        }
        if (status.equals("IN_STOCK")) {
            return "备货中";
        }
        if (status.equals("WAIT_COMMENT")) {
            return "待评论";
        }
        return "退换货";//都不符合的情况返回退货
    }

    public ArrayList<String> getCarIds() {
        return carIds;
    }

    public void setCarIds(ArrayList<String> carIds) {
        this.carIds = carIds;
    }

    public List<String> getShopIds() {
        return shopIds;
    }

    public void setShopIds(List<String> shopIds) {
        this.shopIds = shopIds;
    }

    public List<String> getItemIds() {
        return itemIds;
    }

    public void setItemIds(List<String> itemIds) {
        this.itemIds = itemIds;
    }

    public List<String> getDlytmplIds() {
        return dlytmplIds;
    }

    public void setDlytmplIds(List<String> dlytmplIds) {
        this.dlytmplIds = dlytmplIds;
    }

    public List<String> getPostFees() {
        return postFees;
    }

    public void setPostFees(List<String> postFees) {
        this.postFees = postFees;
    }

    public List<String> getSkuIds() {
        return skuIds;
    }

    public void setSkuIds(List<String> skuIds) {
        this.skuIds = skuIds;
    }

    public List<String> getRemarks() {
        return remarks;
    }

    public void setRemarks(List<String> remarks) {
        this.remarks = remarks;
    }

    public int getIs_global() {
        return is_global;
    }

    public void setIs_global(int is_global) {
        this.is_global = is_global;
    }
}
